// 用户相关类型
export interface User {
  id: number
  username: string
  email: string
  first_name: string
  last_name: string
  is_staff: boolean
}

export interface AuthResponse {
  user: User
  token: string
}

// 电影相关类型
export interface Genre {
  id: number
  name: string
}

export interface Movie {
  id: number
  movie_id: number
  title: string
  year: number | null
  genres: Genre[]
  average_rating: number
}

// 评分相关类型
export interface Rating {
  id: number
  user: number
  movie: number
  rating: number
  timestamp: string
  movie_title: string
  user_name: string
}

// 推荐相关类型
export interface MovieRecommendation {
  movie: Movie
  predicted_rating: number
  similarity_score: number
}

// 用户统计类型
export interface UserStats {
  total_ratings: number
  average_rating: number
  favorite_genres: {
    name: string
    count: number
  }[]
}

// API响应类型
export interface ApiResponse<T> {
  data: T
  status: number
  statusText: string
}

export interface PaginatedResponse<T> {
  count: number
  next: string | null
  previous: string | null
  results: T[]
}

// 留言相关类型
export interface Comment {
  id: number
  user: number
  movie: number
  content: string
  timestamp: string
  user_name: string
  movie_title: string
}

// 管理员相关类型
export interface AdminUser {
  id: number
  username: string
  email: string
  first_name: string
  last_name: string
  is_staff: boolean
  is_active: boolean
  date_joined: string
  rating_count: number
  comment_count: number
}

export interface AdminStatistics {
  rating_distribution: Array<{ rating: number; count: number }>
  comment_stats: Array<{ month: string; count: number }>
  genre_stats: Array<{ name: string; movie_count: number; rating_count: number }>
  user_activity: Array<{ username: string; rating_count: number; comment_count: number }>
  total_stats: {
    total_users: number
    total_movies: number
    total_ratings: number
    total_comments: number
    avg_rating: number
    active_users: number
  }
}

export interface PaginatedResponse<T> {
  count: number
  next: string | null
  previous: string | null
  results: T[]
}